From: Jasper St. Pierre Date: Tue, 11 Jun 2013 22:16:03 +0000 (-0400) Subject: popupMenu: Ignore submenus when getting the column widths X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3942 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ef1eabf033d39b7569a77f1ac8edbef1c4b030d6;p=gnome-shell.git popupMenu: Ignore submenus when getting the column widths The new designs don't want these to be aligned the same way. https://bugzilla.gnome.org/show_bug.cgi?id=702539 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 8f6442f28..1d78ec916 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -890,9 +890,12 @@ const PopupMenuBase = new Lang.Class({ let columnWidths = []; let items = this.box.get_children(); for (let i = 0; i < items.length; i++) { - if (!items[i].visible && - !(items[i]._delegate instanceof PopupSubMenu && items[i-1].visible)) + if (!items[i].visible) continue; + + if (items[i]._delegate instanceof PopupSubMenu) + continue; + if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) { let itemColumnWidths = items[i]._delegate.getColumnWidths(); for (let j = 0; j < itemColumnWidths.length; j++) { @@ -907,6 +910,9 @@ const PopupMenuBase = new Lang.Class({ setColumnWidths: function(widths) { let items = this.box.get_children(); for (let i = 0; i < items.length; i++) { + if (items[i]._delegate instanceof PopupSubMenu) + continue; + if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) items[i]._delegate.setColumnWidths(widths); }